home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-04-25 | 1004 b | 54 lines | [TEXT/CWIE] |
- //
- // CheckUSBRuleFn.c
- //
- //
- //
- // This code is used to verify that the desired version of USB is present.
- //
- //
-
- #include <Types.h>
- #include <MixedMode.h>
- #include <Gestalt.h>
- #include <USB.h>
-
- // this line replaces #include "ActionAtomHeader.h" used in previous 4.0.3 action atoms
- #include "InstallerScript.h"
-
- ActionAtomResult CheckUSBVersFn( RuleFunctionPBPtr rulePBPtr );
-
- enum {
- uppRuleFuncProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(RuleFunctionPBPtr)))
- };
-
- ProcInfoType __procinfo = uppRuleFuncProcInfo;
-
- ActionAtomResult CheckUSBVersFn( RuleFunctionPBPtr rulePBPtr )
- {
- long result;
- OSErr err;
-
- err = Gestalt(gestaltUSBVersion, &result);
- if (err)
- {
- return kFALSERuleFunctionResult;
- }
- else
- {
- // compare the refCon value which is the minimum value of USB that
- // we are looking for
- if (rulePBPtr->fRefCon <= result)
- return kTRUERuleFunctionResult;
- else
- return kFALSERuleFunctionResult;
- }
-
- }
-
-
-
-
-
-